package com.example.pageability;

import com.example.pageability.slice.DetailAbilitySlice;
import com.example.pageability.slice.MainAbilitySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;

public class MainAbility extends Ability {
    @Override
    protected void onAbilityResult(int requestCode, int resultCode, Intent resultData) {
        super.onAbilityResult(requestCode, resultCode, resultData);
        if (requestCode == 1) {
            Text text = (Text) findComponentById(ResourceTable.Id_text_helloworld);
            text.setText(resultData.getStringParam("data"));
        }
    }

    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());
    }
}
